//
//  NEDViewController.m
//  NEDBase
//
//  Created by 林宁宁 on 12/03/2021.
//  Copyright (c) 2021 林宁宁. All rights reserved.
//

#import "NEDViewController.h"
#import "UIViewController+NEDBase.h"
#import "UIButton+NED.h"
#import "NEDConstant.h"
#import "NEDWebViewController.h"

@interface NEDViewController ()

@end

@implementation NEDViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    
    self.title = @"Base";
    self.navigationItem.titleView.backgroundColor = [UIColor clearColor];
    
    WS(weakSelf)
    
    UIButton * btn1 = [UIButton buttonWithType:(UIButtonTypeCustom)];
    btn1.frame = CGRectMake(100, 50, 200, 50);
    btn1.backgroundColor = [UIColor orangeColor];
    [btn1 setTitle:@"push1" forState:UIControlStateNormal];
    [btn1 addActionHandler:^(UIButton *sender, NSInteger tag) {
        [weakSelf.navigationController pushViewController:[NSClassFromString(@"NEDViewController1") new] animated:YES];
    }];
    [self.view addSubview:btn1];
    
    
    UIButton * btn2 = [UIButton buttonWithType:(UIButtonTypeCustom)];
    btn2.frame = CGRectMake(100, 150, 200, 50);
    btn2.backgroundColor = [UIColor orangeColor];
    [btn2 setTitle:@"push2" forState:UIControlStateNormal];
    [btn2 addActionHandler:^(UIButton *sender, NSInteger tag) {
        UIViewController * vc = [NSClassFromString(@"NEDViewController2") new];
        [weakSelf.navigationController pushViewController:vc animated:YES];
    }];
    [self.view addSubview:btn2];
    
    
    UIButton * btn3 = [UIButton buttonWithType:(UIButtonTypeCustom)];
    btn3.frame = CGRectMake(100, 250, 200, 50);
    btn3.backgroundColor = [UIColor orangeColor];
    [btn3 setTitle:@"push3" forState:UIControlStateNormal];
    [btn3 addActionHandler:^(UIButton *sender, NSInteger tag) {
        [weakSelf presentViewController:[NSClassFromString(@"NEDViewController3") new] animated:YES completion:nil];
    }];
    [self.view addSubview:btn3];
    
    
    UIButton * btn4 = [UIButton buttonWithType:(UIButtonTypeCustom)];
    btn4.frame = CGRectMake(100, 350, 200, 50);
    btn4.backgroundColor = [UIColor orangeColor];
    [btn4 setTitle:@"push web" forState:UIControlStateNormal];
    [btn4 addActionHandler:^(UIButton *sender, NSInteger tag) {
        NEDWebViewController * webView = [[NEDWebViewController alloc] initWithURL:@"https://mastergo.com/"];
        webView.navTitle = @"固定标题";
        webView.statusBarFontBlack = @(YES);
        webView.statusBarBgColor = @"#e03131";
        webView.isShowTitleBar = @(NO);
//    http://energybox.jlcalender.com/devCustomerServiceFeedback.html
//        http://energybox.jlcalender.com/customerServiceFeedback.html
//        NEDWebViewController * webView = [NEDWebViewController new];
//        webView.url = @"htts://www.baidu.com";
        [weakSelf.navigationController pushViewController:webView animated:YES];
    }];
    [self.view addSubview:btn4];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
